-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix random crashes using xija_gui_fit on Linux, change limit names for annotation, use CxoTime #108
Conversation
I don't see crashes anymore, but I want @Gregg140 to confirm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of nitpicky style comments that are optional. I cannot say that I reviewed the logic changes in detail, but I did do a functional test to confirm that the fit method fix worked, and ran xija_gui_fit
and went through the basic API functionality with no problems. I also ran the unit tests and they pass.
The limit naming looks good, thanks for going along with the suggested naming convention. With this then we can update all the relevant xija models with limits?
xija/gui_fit/plots.py
Outdated
return [] | ||
lines = [] | ||
draw_line = getattr(ax, f'ax{dir}line') | ||
if 'planning.data_quality.high.acisi' in limits: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could all be factored into an enclosed function draw_line(limit_name, linestyle, color)
which has limits
in scope so you just have a series of calls like:
for limit_name, linestyle, color in [
('planning.data_quality.high.acisi', '-.', 'blue'),
(...)]:
draw_line(limit_name, linestyle, color)
xija/gui_fit/plots.py
Outdated
self.canvas = canvas | ||
self.ax1 = self.canvas.fig.add_subplot(121) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 1, 2, 1
in new code.
The good news is that I could not make it crash. I detected a couple of issues in my tests:
The issue is that on the right hand plot I can't tell if the data continues higher than ~13 or it I'm seeing the precise top of the data. A little padding would be good so that I'm sure I'm seeing the top of the histogram. Example of tests performed: xija_gui_fit dpa_model_spec.json --days 365 --stop 2021:079:00:00:00.00 &
|
@Gregg140 this should be fixed now. |
Crashed when running through the tests I listed. But I winnowed it down to this:
Traceback (most recent call last): |
Thanks for catching that--fixed now. |
@taldcroft I added your suggestions also. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based upon my limited testing of the tool I approve this change.
@taldcroft this is ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
Description
This PR resolves an issue where
xija_gui_fit
would seemingly randomly crash on Linux when manipulating plots. The exact reason is unknown, because I could never seem to produce a traceback of any kind, but many of the plot objects (such asFigure
andAxes
were being re-created every time the data itself needed an update due to a new model fit, etc. This PR implements the changing of the data on the plot itself (for several plot types) instead of re-creating the plot objects with every update, which appears to fix the problem.This PR also does the following:
CxoTime
instead ofChandra.Time
annotate_limits
has been moved from being a method of theXijaModel
class to being a function in thexija_gui_fit
app, since this is the only place it's usedChandra.taco
which is a ska2 remnantTesting
Fixes issue #105.